﻿using System;

namespace BookvarWpf.Windows.Collaboration
{
    /// <summary>
    /// Interaction logic for ConnectToServer.xaml
    /// </summary>
    public partial class ConnectToServer
    {
        public event EventHandler<ConnectClickedEventArgs> ConnectClicked;
        
        protected void OnConnectEvent(ConnectClickedEventArgs args)
        {
            if (ConnectClicked != null)
            {
                ConnectClicked(this, args);
            }
        }

        public ConnectToServer()
        {
            InitializeComponent();
        }

        private void OnConnectClicked(object sender, EventArgs args)
        {
            ConnectClickedEventArgs connectArgs = new ConnectClickedEventArgs(NameTextBox.Text.Trim(), HostTextBox.Text.Trim());
            OnConnectEvent(connectArgs);
        }
    }
}